Skip to content

Conversation

@katywings
Copy link
Contributor

@katywings katywings commented Sep 5, 2025

Design Goals

This PR implements the Ambient CSS import column of the table below. The ?url import + Explicit API column is part of a separate ongoing progress.

# Item Ambient CSS import ?url import + Explicit API Comment
1 Integration manifest-aware lazy Primitive, JSX, Component or routeData?
2 DEV/PROD consistency X X
3 Supports CSS modules X Unlikely?
4 Prevents FOUC X X Flash of unstyled content
5 Prevents FOEC X Flash of early-styled content
6 Renders to head X X
7 Loads on link hover X Unlikely?
8 Prevents rendering duplicates X X
9 Unmounts on client-side navigation X
10 Runtime impact Cheap Expensive
11 Doesn't depend on vite X

Included Fixes

Limitations

  • The lazy transpilation uses a naive approach to narrow down the target files:
    • It can't detect if a file is dynamically imported, so it adds the necessary id$$ export to all jsx/tsx files with export default
    • Lazy loading components from aggregated modules e.g. export { default } from "./xyz.tsx cannot mount the related css, as the aggregated module misses the id$$ from xyz.tsx

New CSS fixture

grafik

Tasks

  • Create an example for css testing
  • ?url imported css should not be server rendered
  • <link> should be mounted before suspension-end during spa navigation
  • Suspension from spa navigation should only end after <link> has been loaded - Will be part of a separate API
  • Assets should be deduplicated on ssr
  • Public manifest and asset mount API (Edit: Public manifest API analog to RFC: Client assets metadata API for SSR vitejs/vite#20913 will be implemented in a different branch)
  • Integrate useAssets in dev (making dev and prod use the same API)
  • Implement unified lazy
  • Optimize unified lazy plugin
  • Test glob import support for lazy
  • Convert assets to tags in the useAssets runtime, instead of the manifest json
  • Test CSS Order, is it better? Is it the same?

@changeset-bot
Copy link

changeset-bot bot commented Sep 5, 2025

⚠️ No Changeset found

Latest commit: 206e659

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@katywings katywings marked this pull request as draft September 5, 2025 15:45
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@1965

commit: 206e659

@katywings katywings force-pushed the devinxi-css branch 2 times, most recently from 7a38420 to 3974bd3 Compare September 17, 2025 16:11
@brenelz
Copy link
Contributor

brenelz commented Oct 24, 2025

This is still going to be post-devinxi into main?

@brenelz
Copy link
Contributor

brenelz commented Oct 24, 2025

bunch of conflicts now too

@katywings katywings force-pushed the devinxi-css branch 2 times, most recently from 7945276 to c9dd38e Compare October 25, 2025 13:34
@katywings
Copy link
Contributor Author

This is still going to be post-devinxi into main?

@brenelz It's still up for discussion of this is going straight into devinxi or if it is going into main. Why 😅?

@katywings
Copy link
Contributor Author

bunch of conflicts now too

@brenelz Just rebased it, conflicts are gone 😃. Next on my TODO list: rework the DEV part (try to render <link> in dev, instead of <style>).

@katywings katywings force-pushed the devinxi-css branch 6 times, most recently from 5518528 to 27fef42 Compare October 28, 2025 15:58
@katywings katywings force-pushed the devinxi-css branch 7 times, most recently from c4bd8c2 to c539295 Compare November 4, 2025 20:03
Base automatically changed from devinxi to main November 7, 2025 13:22
@netlify
Copy link

netlify bot commented Nov 7, 2025

Deploy Preview for solid-start-landing-page failed. Why did it fail? →

Name Link
🔨 Latest commit 206e659
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6918b59cf110630008b7dcff

@katywings katywings force-pushed the devinxi-css branch 2 times, most recently from 62c43d2 to 978933f Compare November 8, 2025 19:45
@katywings katywings changed the title WIP: Devinxi - Unified css handling Devinxi - Unified css handling Nov 8, 2025
@katywings katywings changed the title Devinxi - Unified css handling Devinxi - Unified CSS handling Nov 8, 2025
Copy link
Contributor

@brenelz brenelz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good

@katywings katywings force-pushed the devinxi-css branch 4 times, most recently from 7b4838e to 73f49b3 Compare November 12, 2025 22:33
@katywings katywings marked this pull request as ready for review November 12, 2025 23:23
@katywings katywings merged commit 7c8b6f3 into main Nov 18, 2025
5 of 9 checks passed
@katywings katywings deleted the devinxi-css branch November 18, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

6 participants